Optimal. Leaf size=69 \[ \frac{a (B+i A) \tan (c+d x)}{d}-\frac{a (A-i B) \log (\cos (c+d x))}{d}-a x (B+i A)+\frac{i a B \tan ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0555895, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.1, Rules used = {3592, 3525, 3475} \[ \frac{a (B+i A) \tan (c+d x)}{d}-\frac{a (A-i B) \log (\cos (c+d x))}{d}-a x (B+i A)+\frac{i a B \tan ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3592
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int \tan (c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=\frac{i a B \tan ^2(c+d x)}{2 d}+\int \tan (c+d x) (a (A-i B)+a (i A+B) \tan (c+d x)) \, dx\\ &=-a (i A+B) x+\frac{a (i A+B) \tan (c+d x)}{d}+\frac{i a B \tan ^2(c+d x)}{2 d}+(a (A-i B)) \int \tan (c+d x) \, dx\\ &=-a (i A+B) x-\frac{a (A-i B) \log (\cos (c+d x))}{d}+\frac{a (i A+B) \tan (c+d x)}{d}+\frac{i a B \tan ^2(c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.306199, size = 70, normalized size = 1.01 \[ \frac{a \left ((-2 B-2 i A) \tan ^{-1}(\tan (c+d x))+2 (B+i A) \tan (c+d x)-2 (A-i B) \log (\cos (c+d x))+i B \tan ^2(c+d x)\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.005, size = 110, normalized size = 1.6 \begin{align*}{\frac{{\frac{i}{2}}aB \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{d}}+{\frac{iaA\tan \left ( dx+c \right ) }{d}}+{\frac{aB\tan \left ( dx+c \right ) }{d}}+{\frac{a\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) A}{2\,d}}-{\frac{{\frac{i}{2}}a\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) B}{d}}-{\frac{iaA\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}}-{\frac{aB\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.64783, size = 92, normalized size = 1.33 \begin{align*} -\frac{-i \, B a \tan \left (d x + c\right )^{2} - 2 \,{\left (d x + c\right )}{\left (-i \, A - B\right )} a -{\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \,{\left (-i \, A - B\right )} a \tan \left (d x + c\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.46938, size = 304, normalized size = 4.41 \begin{align*} -\frac{2 \,{\left (A - 2 i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + 2 \,{\left (A - i \, B\right )} a +{\left ({\left (A - i \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \,{\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} +{\left (A - i \, B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.95594, size = 110, normalized size = 1.59 \begin{align*} \frac{a \left (- A + i B\right ) \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac{- \frac{\left (2 A a - 4 i B a\right ) e^{- 2 i c} e^{2 i d x}}{d} - \frac{\left (2 A a - 2 i B a\right ) e^{- 4 i c}}{d}}{e^{4 i d x} + 2 e^{- 2 i c} e^{2 i d x} + e^{- 4 i c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.2918, size = 262, normalized size = 3.8 \begin{align*} -\frac{A a e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, B a e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 2 i \, B a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a e^{\left (2 i \, d x + 2 i \, c\right )} - 4 i \, B a e^{\left (2 i \, d x + 2 i \, c\right )} + A a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, B a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a - 2 i \, B a}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]